package base.thread;//package com.example.demo.thread;
//
//import android.os.Bundle;
//import android.support.annotation.Nullable;
//import android.support.v7.app.AppCompatActivity;
//
//import org.json.JSONObject;
//import org.reactivestreams.Subscriber;
//
//import io.reactivex.Observable;
//import io.reactivex.ObservableEmitter;
//import io.reactivex.ObservableOnSubscribe;
////import okhttp3.OkHttpClient;
////import retrofit2.Call;
////import retrofit2.Callback;
////import retrofit2.Response;
////import retrofit2.Retrofit;
////import retrofit2.converter.gson.GsonConverterFactory;
//
//
///**
// * 用于rxjava中的一些学习
// */
//public class RxJavaDemo extends AppCompatActivity {
//
//    @Override
//    protected void onCreate( Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//
//
//
//    }
//
//
//    private void observableTest(){
////        Observable observable= Observable.create(new ObservableOnSubscribe() {
////            @Override
////            public void subscribe(ObservableEmitter e) throws Exception {
////
////            }
////        });
//
//
////        Observable observables = Observable.create(new Observable.OnSubscribe<String>() {
////            @Override
////            public void call(Subscriber<? super String> subscriber) {
////                subscriber.onNext("Hello");
////                subscriber.onNext("Hi");
////                subscriber.onNext("Aloha");
////                subscriber.onCompleted();
////            }
////        });
//
//
//
//
//
//    }
//
//
//    private void trains01(){
//        String name="....asdf";
////        Observable.from(name)
////                .subscribe();
//        Observable.create(new ObservableOnSubscribe<String>() {
//            @Override
//            public void subscribe(ObservableEmitter<String> e) throws Exception {
//                e.onNext("aaaaaaa");
//            }
//        });
//
//
////        Observable.just(name)
////                .flatMap()
//
////        Call
//
//
//
//    }
//
//
//    private void retrofitTrainsTest(){
////        OkHttpClient okHttpClient = new OkHttpClient();
////        Retrofit retrofit = new Retrofit.Builder().baseUrl("www.xxxx.com")
////                .client(okHttpClient)
////                .addConverterFactory(GsonConverterFactory.create(buildGson()))
////                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
////                .build();
//
//
//
//    }
//
//
//    private void requestRetrofit(){
////        Retrofit retrofit = new Retrofit.Builder().baseUrl("www.xxxx.com/").build();
////        PersonalProtocol personalProtocol = retrofit.create(PersonalProtocol.class);
////        Call<Response<JSONObject>> call = personalProtocol.getPersonalListInfo(12);
////        call.enqueue(new Callback<Response<JSONObject>>() {
////            @Override
////            public void onResponse(Call<Response<JSONObject>> call, Response<Response<JSONObject>> response) {
////                //数据请求成功
////            }
////
////            @Override
////            public void onFailure(Call<Response<JSONObject>> call, Throwable t) {
////                //数据请求失败
////            }
////        });
//    }
//
//
//
//}
